﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Ribbon.cs" company="Concept Architecture">
//   (c) 2010 Muhammad Umer Farooq
// </copyright>
// <summary>
//   Defines the Ribbon type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Hisaab.Windows.RibbonWrapper.FluentLibrary
{
    using System;
    using System.Collections.ObjectModel;
    using System.Linq;

    /// <summary>
    /// Defines the <seealso cref="Ribbon"/> type.
    /// </summary>
    public class Ribbon : IRibbon
    {
        /// <summary>
        /// Underlying ribbon control
        /// </summary>
        private readonly Fluent.Ribbon _ribbon;

        /// <summary>
        /// Initializes a new instance of the <see cref="Ribbon"/> class.
        /// </summary>
        /// <param name="ribbon">The ribbon.</param>
        public Ribbon(Fluent.Ribbon ribbon)
        {
            _ribbon = ribbon;
        }

        /// <summary>
        /// Gets the contextual tab groups.
        /// </summary>
        /// <value>
        /// The contextual tab groups.
        /// </value>
        public ObservableCollection<IRibbonContextualTabGroup> ContextualTabGroups
        {
            get
            {
                return
                    new ObservableCollection<IRibbonContextualTabGroup>(_ribbon.ContextualGroups.Select(x => new RibbonContextualTabGroup(x)));
            }
        }
    }
}